import axios from 'axios';

const API_URL = 'http://localhost:8080/api/employees';

//使用命名导出
export const getEmployees = () => {
  return axios.get(API_URL);
};

export const createEmployee = (employee) => {
  return axios.post(API_URL, employee);
};

export const updateEmployee = (id, updates) => {
  return axios.put(`${API_URL}/${id}`, updates);
};

export const deleteEmployee = (id) => {
  return axios.delete(`${API_URL}/${id}`);
};